package com.labofjet.test;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.PropertyValue;

public class BeanWrapperTest1 {
    String field1;
    List<String> field2 = new ArrayList<String>();

    public static void main(String[] args) {
        BeanWrapperTest1 bt1 = new BeanWrapperTest1();
        BeanWrapper bw = new BeanWrapperImpl(bt1);
        PropertyValue pv = new PropertyValue("field1", "a");
        PropertyValue pv2 = new PropertyValue("field2[0]", "field2Value");
        bw.setPropertyValue(pv);
        bw.setPropertyValue(pv2);
        System.out.println(bt1.field1);
        System.out.println(bt1.field2);
        
    }

    public String getField1() {
        return field1;
    }

    public void setField1(String field1) {
        this.field1 = field1;
    }

    public List<String> getField2() {
        return field2;
    }

    public void setField2(List<String> field2) {
        this.field2 = field2;
    }



}
